﻿using Corina.Datamodel.Base;
using Corina.Datamodel.Interface;
using Corina.Enumerations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace Corina.Datamodel.Entities
{
    [XmlTypeAttribute(Namespace = "http://tempuri.org/")]
    public class AvatarInfo : DatamodelEntity, IAvatar
    {
        #region Fields
        private int _id;
        private int _accountId = 0;
        private string _url;
        private AccountTypeValue _accountType = AccountTypeValue.Manager;
        #endregion

        #region Properties
        public int Id
        {
            get { return _id; }
            set
            {
                _id = value;
                RaisePropertyChanged(() => Id);
            }
        }
        
        public int AccountId
        {
            get { return _accountId; }
            set
            {
                _accountId = value;
                RaisePropertyChanged(() => AccountId);
            }
        }
        
        public string Url
        {
            get { return _url; }
            set
            {
                _url = value;
                RaisePropertyChanged(() => Url);
            }
        }
        
        public AccountTypeValue AccountType
        {
            get { return _accountType; }
            set
            {
                _accountType = value;
                RaisePropertyChanged(() => AccountType);
            }
        }
        #endregion

        protected override IEnumerable<DatabaseColumn> InitColumns()
        {
            yield return new DatabaseColumn("Id", true);
            yield return new DatabaseColumn("AccountId", false, true);
            yield return new DatabaseColumn("Url");
            yield return new DatabaseColumn("AccountType", false, true);
        }
    }
}